package com.openfarmanager.android;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import com.openfarmanager.android.controllers.EditViewController;
import com.openfarmanager.android.fragments.Viewer;
import com.openfarmanager.android.fragments.ViewerToolbar;

import java.io.File;

/**
 * File viewer activity
 */
public class FileView extends FragmentActivity {

    private EditViewController controller;

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.view_activity);
        FragmentManager manager = getSupportFragmentManager();
        controller = new EditViewController((Viewer) manager.findFragmentById(R.id.viewer),
                (ViewerToolbar) manager.findFragmentById(R.id.toolbar));
        ((Viewer) manager.findFragmentById(R.id.viewer)).openFile(new File(getIntent().getData().getPath()));
    }

}